﻿<!DOCTYPE html>
<html>
    <head>
		<title>jQuery/traversing</title>
        <meta charset="utf-8">
		<style>
			.syntax { color: red;}
			.colorRed {color: red;}
			.colorGreen {color: green;}
			.colorBlue {color: blue;}
            div {
                margin: 3px;
                width: 50px;
                height: 50px;
                /*position: absolute;*/
                left: 10px;
                top: 300px;
                background-color: yellow;
                /*display:none;*/
            }
            div.newcolor {
                background-color: red;
            }
  		</style>
        <script src="script/jquery-3.5.1.js"></script>
        <script>
		    console.log( "jQuery version: " + $.fn.jquery );
        </script>
    </head>
    <body>
        <h1>jQuery/traversing部分展示</h1>		
		<table>
            <tr>
                <td class="syntax">.add()</td>
                <td>创建一个新的jQuery object, 并将入参的elements加到其匹配集中. 注意, 不是向html或DOM中添加element.</td>
            </tr>
            <tr>
                <td class="syntax">.addBack()</td>
                <td>Add the previous set of elements on the stack to the current set, optionally filtered by a selector.</td>
            </tr>
            <tr>
                <td class="syntax">.andSelf()</td>
                <td>removed.</td>
            </tr>
            <tr>
                <td class="syntax">.children()</td>
                <td>Get the children of each element in the set of matched elements, optionally filtered by a selector.</td>
            </tr>
            <tr>
                <td class="syntax">.closest()</td>
                <td>For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.</td>
            </tr>
            <tr>
                <td class="syntax">.contents()</td>
                <td>Get the children of each element in the set of matched elements, including text and comment nodes.</td>
            </tr>
            <tr>
                <td class="syntax">.each()</td>
                <td>Iterate over a jQuery object, executing a function for each matched element.</td>
            </tr>
            <tr>
                <td class="syntax">.end()</td>
                <td>End the most recent filtering operation in the current chain and return the set of matched elements to its previous state.</td>
            </tr>
            <tr>
                <td class="syntax">.eq()</td>
                <td>Reduce the set of matched elements to the one at the specified index.</td>
            </tr>
            <tr>
                <td class="syntax">.even()</td>
                <td>Reduce the set of matched elements to the even ones in the set, numbered from zero.</td>
            </tr>
            <tr>
                <td class="syntax">.filter()</td>
                <td>Reduce the set of matched elements to those that match the selector or pass the function’s test.</td>
            </tr>
            <tr>
                <td class="syntax">.find()</td>
                <td> Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element.</td>
            </tr>
            <tr>
                <td class="syntax">.first()</td>
                <td>Reduce the set of matched elements to the first in the set.</td>
            </tr>
            <tr>
                <td class="syntax">.has()</td>
                <td>Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element.</td>
            </tr>
            <tr>
                <td class="syntax">.is()</td>
                <td>Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments.</td>
            </tr>
            <tr>
                <td class="syntax">.last()</td>
                <td>Reduce the set of matched elements to the final one in the set.</td>
            </tr>
            <tr>
                <td class="syntax">.map()</td>
                <td>Pass each element in the current matched set through a function, producing a new jQuery object containing the return values.</td>
            </tr>
            <tr>
                <td class="syntax">.next()</td>
                <td>Get the immediately following sibling of each element in the set of matched elements. If a selector is provided, it retrieves the next sibling only if it matches that selector.</td>
            </tr>
            <tr>
                <td class="syntax">.nextAll()</td>
                <td>Get all following siblings of each element in the set of matched elements, optionally filtered by a selector.</td>
            </tr>
            <tr>
                <td class="syntax">.nextUntil()</td>
                <td>Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed.</td>
            </tr>
            <tr>
                <td class="syntax">.not()</td>
                <td>Remove elements from the set of matched elements.</td>
            </tr>
            <tr>
                <td class="syntax">.odd()</td>
                <td>Reduce the set of matched elements to the odd ones in the set, numbered from zero.</td>
            </tr>
            <tr>
                <td class="syntax">.offsetParent()</td>
                <td>Get the closest ancestor element that is positioned.</td>
            </tr>
            <tr>
                <td class="syntax">.parent()</td>
                <td>Get the parent of each element in the current set of matched elements, optionally filtered by a selector.</td>
            </tr>
            <tr>
                <td class="syntax">.parents()</td>
                <td>Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector.</td>
            </tr>
            <tr>
                <td class="syntax">.parentsUntil()</td>
                <td>Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object.</td>
            </tr>
            <tr>
                <td class="syntax">.prev()</td>
                <td>Get the immediately preceding sibling of each element in the set of matched elements. If a selector is provided, it retrieves the previous sibling only if it matches that selector.</td>
            </tr>
            <tr>
                <td class="syntax">.prevAll()</td>
                <td>Get all preceding siblings of each element in the set of matched elements, optionally filtered by a selector.</td>
            </tr>
            <tr>
                <td class="syntax">.prevUntil()</td>
                <td>Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object.</td>
            </tr>
            <tr>
                <td class="syntax">.siblings()</td>
                <td>Get the siblings of each element in the set of matched elements, optionally filtered by a selector.</td>
            </tr>
            <tr>
                <td class="syntax">.slice()</td>
                <td>Reduce the set of matched elements to a subset specified by a range of indices.</td>
            </tr>
        </table>
        <p></p>
    <hr/>
    请打开console观察输出.
    
    </body>
</html>
